package router

import (
	"github.com/gin-gonic/gin"
	"mxshop-api/goods-web/api/category"
	"mxshop-api/goods-web/middlewares"
)

/*
*
注册分类的路由
*/
func InitCategoryRouter(Router *gin.RouterGroup) {
	BannerRouter := Router.Group("category").Use(middlewares.Tracing())
	{
		BannerRouter.GET("", category.List)                                 //获取category的列表
		BannerRouter.GET("/:id", middlewares.JWTAuth(), category.Detail)    //修改category
		BannerRouter.POST("", middlewares.JWTAuth(), category.New)          //添加category
		BannerRouter.PUT("/:id", middlewares.JWTAuth(), category.Update)    //修改category
		BannerRouter.DELETE("/:id", middlewares.JWTAuth(), category.Delete) //删除category
	}
}
